namespace W2R.Core.Migrations
{
    using System.Data.Entity.Migrations;
    
    public partial class InitialMigration : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "Tags",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        Name = c.String(nullable: false, maxLength: 50),
                        Active = c.Boolean(nullable: false),
                        Book_Id = c.Guid(),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("Books", t => t.Book_Id)
                .Index(t => t.Book_Id);
            
            CreateTable(
                "Books",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        CoverId = c.String(nullable: false),
                        FileId = c.String(nullable: false),
                        Active = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "Users",
                c => new
                    {
                        Id = c.Guid(nullable: false, identity: true),
                        Name = c.String(nullable: false, maxLength: 100),
                        Active = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropIndex("Tags", new[] { "Book_Id" });
            DropForeignKey("Tags", "Book_Id", "Books");
            DropTable("Users");
            DropTable("Books");
            DropTable("Tags");
        }
    }
}
